export const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '模块名称',
			prop: 'moudleName',
			type: 'input',
			span: 8,
		},
		{
			label: '角色名称',
			prop: 'roleName',
			type: 'input',
			span: 8,
		},
	],
}

export const tableConfig = {
	stripe: true,
	border: true,
	columns: [
		{ label: '模块名称', prop: 'moudleName' },
		{ label: '角色名称', prop: 'roleName' },
		{ label: '创建时间', prop: 'createTime' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const api = {
	index: 'view_workbenchConfig_page',
	add: 'saveWorkSpace',
	edit: 'view_workbenchConfig_edit',
	delete: 'view_workbenchConfig_del',
}
export const auth = {
	index: 'view_workbenchConfig_page',
	add: 'view_workbenchConfig_add',
	edit: 'view_workbenchConfig_edit',
	delete: 'view_workbenchConfig_del',
	mulitSet: 'mulitSet',
}
export const baseConfig = {
	pageName: '工作台配置',
	dictcodes: ['ROLE_TIER'],
	rowKey: 'id',
	addLabel: '新增',
	tipLabel: 'moudleName',
	exportMqTopic: '/ning/export/',
	params: {
		delFlag: 0,
	},
	api,
	auth,
	menuBtn: [
		{
			icon: 'detail',
			label: '预览',
			type: 'primary',
			operate: 'preview',
			auth: '',
			text: true,
			show: true,
		},
		{
			icon: 'editor',
			label: '编辑',
			type: 'primary',
			operate: 'edit',
			auth: auth.edit,
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			type: 'danger',
			operate: 'delete',
			auth: auth.delete,
			text: true,
			show: true,
		},
	],

	saveFormate: async (form) => {
		return new Promise((resolve, reject) => {
			resolve(form)
		})
	},
	dialogConfig: {
		fullscreen: true,
	},
	searchConfig,
	tableConfig,
}
